package org.xyl.service;

import java.util.List;
import java.util.Map;

/**
 * MCP核心业务逻辑服务接口
 */
public interface McpService {
    
    // 1. 知识库搜索工具
    List<KnowledgeBaseResult> searchKnowledgeBase(String query, String documentType, int maxResults);
    
    // 2. 获取设备状态工具
    DeviceStatus getDeviceStatus(String deviceId);
    
    // 3. 分析设备日志工具
    LogAnalysisResult analyzeDeviceLogs(String deviceId, String timeRange);
    
    // 4. 创建支持工单工具
    SupportTicket createSupportTicket(String customerId, String deviceId, String problemDescription, String priority);
    
    // 知识搜索结果
    class KnowledgeBaseResult {
        private String id;
        private String title;
        private String content;
        private String source;
        private double score;
        
        // Getters and Setters
        public String getId() { return id; }
        public void setId(String id) { this.id = id; }
        public String getTitle() { return title; }
        public void setTitle(String title) { this.title = title; }
        public String getContent() { return content; }
        public void setContent(String content) { this.content = content; }
        public String getSource() { return source; }
        public void setSource(String source) { this.source = source; }
        public double getScore() { return score; }
        public void setScore(double score) { this.score = score; }
    }
    
    // 设备状态
    class DeviceStatus {
        private String deviceId;
        private String status;
        private double batteryVoltage;
        private int signalStrength;
        private double temperature;
        private String lastOnlineTime;
        private String firmwareVersion;
        
        // Getters and Setters
        public String getDeviceId() { return deviceId; }
        public void setDeviceId(String deviceId) { this.deviceId = deviceId; }
        public String getStatus() { return status; }
        public void setStatus(String status) { this.status = status; }
        public double getBatteryVoltage() { return batteryVoltage; }
        public void setBatteryVoltage(double batteryVoltage) { this.batteryVoltage = batteryVoltage; }
        public int getSignalStrength() { return signalStrength; }
        public void setSignalStrength(int signalStrength) { this.signalStrength = signalStrength; }
        public double getTemperature() { return temperature; }
        public void setTemperature(double temperature) { this.temperature = temperature; }
        public String getLastOnlineTime() { return lastOnlineTime; }
        public void setLastOnlineTime(String lastOnlineTime) { this.lastOnlineTime = lastOnlineTime; }
        public String getFirmwareVersion() { return firmwareVersion; }
        public void setFirmwareVersion(String firmwareVersion) { this.firmwareVersion = firmwareVersion; }
    }
    
    // 日志分析结果
    class LogAnalysisResult {
        private String deviceId;
        private List<String> errorMessages;
        private List<LogPattern> patterns;
        private String summary;
        
        // Getters and Setters
        public String getDeviceId() { return deviceId; }
        public void setDeviceId(String deviceId) { this.deviceId = deviceId; }
        public List<String> getErrorMessages() { return errorMessages; }
        public void setErrorMessages(List<String> errorMessages) { this.errorMessages = errorMessages; }
        public List<LogPattern> getPatterns() { return patterns; }
        public void setPatterns(List<LogPattern> patterns) { this.patterns = patterns; }
        public String getSummary() { return summary; }
        public void setSummary(String summary) { this.summary = summary; }
        
        // 日志模式类
        public static class LogPattern {
            private String pattern;
            private int count;
            private String severity;
            
            // Getters and Setters
            public String getPattern() { return pattern; }
            public void setPattern(String pattern) { this.pattern = pattern; }
            public int getCount() { return count; }
            public void setCount(int count) { this.count = count; }
            public String getSeverity() { return severity; }
            public void setSeverity(String severity) { this.severity = severity; }
        }
    }
    
    // 支持工单
    class SupportTicket {
        private String ticketId;
        private String customerId;
        private String deviceId;
        private String problemDescription;
        private String priority;
        private String status;
        private String createdAt;
        
        // Getters and Setters
        public String getTicketId() { return ticketId; }
        public void setTicketId(String ticketId) { this.ticketId = ticketId; }
        public String getCustomerId() { return customerId; }
        public void setCustomerId(String customerId) { this.customerId = customerId; }
        public String getDeviceId() { return deviceId; }
        public void setDeviceId(String deviceId) { this.deviceId = deviceId; }
        public String getProblemDescription() { return problemDescription; }
        public void setProblemDescription(String problemDescription) { this.problemDescription = problemDescription; }
        public String getPriority() { return priority; }
        public void setPriority(String priority) { this.priority = priority; }
        public String getStatus() { return status; }
        public void setStatus(String status) { this.status = status; }
        public String getCreatedAt() { return createdAt; }
        public void setCreatedAt(String createdAt) { this.createdAt = createdAt; }
    }
}
